package org.dut.community.entity;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.HashMap;
import java.util.Map;


@Builder
@Getter
@Setter
@ToString
public class Event {
    private  String topic; // 事件类型
    private int userId; // 触发事件的人

    // 事件目标的实体
    private int entityType;
    private int entityId;
    private int entityUserId;  //  实体作者

    private Map<String, Object> data;

    public Event setData(String key, Object value) {
        if(data == null){
            data = new HashMap<>();
        }
        data.put(key, value);
        return this;
    }


}
